<template>
	<view>
		<!-- 返回上一页 -->
		<view class="" style="width: 100%; background: #fff;">
			<view class="" 
				style="width: 90%;padding-top: 60rpx; margin: auto; height: 100rpx; display: flex; align-items: center; ">
				<image @click="toReturn" style="width: 50rpx; height: 50rpx;" src="../../../static/images/goBack.png"></image>
				<span style="margin-left: 20rpx;">帮助中心</span>
			</view>
			<!-- 介绍 -->
			<view style="width: 90%; margin: auto;" v-if="vShow"> 
			<p v-for="(item ,index) in dataList"  @click="toForm(item)"  style="height: 100rpx; border-bottom: 2rpx solid #ccc;
			 display: flex; align-items: center;font-size: 20rpx; font-weight: 600;">{{item.title}}</p>
			</view>
			<!-- 详情 -->
			<view v-if="vShow==false" style="width: 90%; margin: auto;">
				<image @click="toShow" style=" margin: 40rpx 0; width: 50rpx; height: 50rpx;" src="../../../static/images/user/x.png"></image>
				<p style="font-size: 30rpx; font-weight: 600; margin: 15rpx 0;">{{dataName.title}}</p>
				<text style="font-size: 25rpx;" v-html="dataName.content"></text>
			</view>
		</view>
	</view>
</template>

<script>
	import {getMyHelp} from '@/http/api.js'
	export default {
		data() {
			return {
				vShow:true,
				dataName:{},
			dataList:[]
			};
		},
		onLoad() {
			this.MyHelp()
		},
		methods:{
			// 帮助中心接口
			MyHelp(){
				getMyHelp().then((res)=>{
					this.dataList = res[1].data.data
					console.log(res[1].data.data,"帮助中心接口");
				})
			},
			// 返回上一页
			toReturn(){
				  uni.navigateBack();
			},
			// 点击详情
			toForm(item){
				this.dataName= item
				this.vShow =!this.vShow
			},
			toShow(){
				this.vShow =!this.vShow
			}
		}
	}
</script>

<style lang="scss">

</style>
